package com.qingxin.park.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.annotations.GenericGenerator;

/**
 * 生产环节使用农资表
 */
@Entity
@Table(name = "pro_record_material")
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class ProRecordMaterial extends com.qingxin.sys.entity.BaseEntity
		implements java.io.Serializable {
	private static final long serialVersionUID = -6758750280906004911L;
	// Fields

	private String id;
	private ProRecord proRecord;
	private String materialid;
	private String materialName;
	private String accountid;
	private Double amount;
	private String units;
	private String remark;
	private String createBy;
	private Date createTime;

	// Constructors

	/** default constructor */
	public ProRecordMaterial() {
	}

	/** minimal constructor */
	public ProRecordMaterial(ProRecord proRecord) {
		this.proRecord = proRecord;
	}

	/** full constructor */
	public ProRecordMaterial(ProRecord proRecord, String materialid, String materialName,String accountid, 
			Double amount, String units, String remark, String createBy, Date createTime) {
		this.proRecord = proRecord;
		this.materialid = materialid;
		this.materialName = materialName;
		this.accountid = accountid;
		this.amount = amount;
		this.units = units;
		this.remark = remark;
		this.createBy = createBy;
		this.createTime = createTime;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "recordid", nullable = false)
	public ProRecord getProRecord() {
		return this.proRecord;
	}

	public void setProRecord(ProRecord proRecord) {
		this.proRecord = proRecord;
	}

	@Column(name = "materialid", length = 32)
	public String getMaterialid() {
		return this.materialid;
	}

	public void setMaterialid(String materialid) {
		this.materialid = materialid;
	}
	
	@Column(name = "material_name", length = 50)
	public String getMaterialName() {
		return this.materialName;
	}

	public void setMaterialName(String materialName) {
		this.materialName = materialName;
	}
	
	@Column(name = "accountid", length = 32)
	public String getAccountid() {
		return accountid;
	}

	public void setAccountid(String accountid) {
		this.accountid = accountid;
	}

	@Column(name = "amount", precision = 53, scale = 0)
	public Double getAmount() {
		return this.amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	@Column(name = "units", length = 20)
	public String getUnits() {
		return this.units;
	}

	public void setUnits(String units) {
		this.units = units;
	}
	
	@Column(name = "remark", length = 1000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "create_by", length = 32)
	public String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	@Column(name = "create_time", length = 23)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

}